-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor simplification of trim_cell #347
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #347 +/- ##
===========================================
- Coverage 83.56% 83.55% -0.01%
===========================================
Files 24 24
Lines 8157 8154 -3
===========================================
- Hits 6816 6813 -3
Misses 1341 1341
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
I also agree to use integer matrices as possible. BTW, can you write a description for |
@lan496, thanks for your review. I added some descriptions.
Do you mean the word trim is not intuitive? |
// @param tensor_rank rank of site tensors for magnetic symmetry. Set -1 if | ||
// not used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My line length setting is considered different from the original code. Do we have a formatter to make it same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using clang-format
by default? I'm not sure on VSCode, but on CLion there is an option to use clang-format
instead of the built-in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your info. @LecrisUT. I use VSCode, and my current setting is like below,
"C_Cpp.clang_format_style": "{BasedOnStyle: Google, IndentWidth: 4}",
I found some information, https://code.visualstudio.com/docs/cpp/cpp-ide#_code-formatting . I should read this in detail.
Yes, I felt nonintuitive because
|
Sorry, I missed the returned |
Clearly the code is confusing and we should refactor it, but not in this PR. |
The nearest integer matrix of
axis_inv
istmat_p_i
at line ~520 in functiontranslate_atoms_in_trimmed_lattice
. I prefer the later because I want to have a transformation matrix to be an integer matrix or inverse of an integer matrix whenever possible.Actually,
axis_inv
is unnecessary to be computed intranslate_atoms_in_trimmed_lattice
because it is same astmp_mat
in functiontrim_cell
that callstranslate_atoms_in_trimmed_lattice
andtranslate_atoms_in_trimmed_lattice
is called only fromtrim_cell
.Although
axis_inv
andtmat_p_i
can be slightly different if the input cell is distorted, I would like to suggest this change.